
<form name="editForm" role="form" novalidate ng-submit="vm.save()" show-validation>

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">&times;</button>
        <h4 class="modal-title" id="myPropertyValueLabel" data-translate="gatewayApp.propertyValue.home.createOrEditLabel">Create or edit a Property Value</h4>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" ng-show="vm.propertyValue.id">
            <label for="id" data-translate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                    ng-model="vm.propertyValue.id" readonly />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="gatewayApp.propertyValue.value" for="field_value">Value</label>
                <textarea class="form-control" name="value" id="field_value"
                    ng-model="vm.propertyValue.value" ></textarea>
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="gatewayApp.propertyValue.langKey" for="field_langKey">Lang Key</label>
            <input type="text" class="form-control" name="langKey" id="field_langKey"
                    ng-model="vm.propertyValue.langKey"
                    ng-maxlength="8"/>
            <div ng-show="editForm.langKey.$invalid">
                <p class="help-block"
                    ng-show="editForm.langKey.$error.maxlength" data-translate="entity.validation.maxlength" translate-value-max="8">
                    This field cannot be longer than 8 characters.
                </p>
            </div>
        </div>

        <div class="form-group">
            <label data-translate="gatewayApp.propertyValue.page" for="field_page">Page</label>
            <select class="form-control" id="field_page" name="page" ng-model="vm.propertyValue.pageId" ng-options="page.id as page.name for page in vm.pages"             required>
            </select>
        </div>
        <div ng-show="editForm.page.$invalid">
            <p class="help-block"
                ng-show="editForm.page.$error.required" data-translate="entity.validation.required">
                This field is required.
            </p>
        </div>
        <div class="form-group">
            <label data-translate="gatewayApp.propertyValue.property" for="field_property">Property</label>
            <select class="form-control" id="field_property" name="property" ng-model="vm.propertyValue.propertyId" ng-options="templateProperty.id as templateProperty.name for templateProperty in vm.templateproperties"             required>
            </select>
        </div>
        <div ng-show="editForm.property.$invalid">
            <p class="help-block"
                ng-show="editForm.property.$error.required" data-translate="entity.validation.required">
                This field is required.
            </p>
        </div>
        <div class="form-group">
            <label data-translate="gatewayApp.propertyValue.material" for="field_material">Material</label>
            <select class="form-control" id="field_material" name="material" ng-model="vm.propertyValue.materialId" ng-options="material.id as material.name for material in vm.materials"            >
                <option value=""></option>
            </select>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span data-translate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary">
            <span class="glyphicon glyphicon-save"></span>&nbsp;<span data-translate="entity.action.save">Save</span>
        </button>
    </div>
</form>
